<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"> 
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>登录页</title>
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css">
    
    <script src="__PUBLIC__/layui/layui.js"></script>
    <script src="__PUBLIC__/admin/js/jquery.min.js"></script>
 
</head>
<style type="text/css">
    input::-webkit-input-placeholder {
        color: rgb(201,211,215);
    }
    input:-ms-input-placeholder{
        color: rgb(201,211,215);
    }
    input::-moz-placeholder, textarea::-moz-placeholder {
        color: rgb(201,211,215);
    }input::-webkit-input-placeholder {
             color: rgb(201,211,215);
     }
    input:-ms-input-placeholder{
        color: rgb(201,211,215);
    }
    input::-moz-placeholder, textarea::-moz-placeholder {
        color: rgb(201,211,215);
    }



    .login-main {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 350px;
        margin: 0 auto;
    }
     
    .login-main header {
        margin-top: 150px;
        height: 35px;
        line-height: 35px;
        font-size: 30px;
        font-weight: 100;
        text-align: center;
    }
     
    .login-main header, .login-main form, .login-main form .layui-input-inline {
        margin-bottom: 15px;
    }
     
    .login-main form .layui-input-inline, .login-main form .layui-input-inline input, .login-main form .layui-input-inline button {
        width: 100%;
    }
     
    .login-main form .login-btn {
        margin-bottom: 5px;
    }

    .jianbian{
        background:-webkit-linear-gradient(top,#fff,#5e96e4 40%,#5e96e4 60%,#fff);
        -webkit-background-clip:text;
        -webkit-text-fill-color:transparent;
        text-transform:uppercase;
    }
</style>
<body class="custom-background-image" >
 
    <div class="login-main" >
       <!-- <header class="layui-elip jianbian" style="margin-top: 80px;font-style: italic;font-size:45px;color: #5e96e4;"><strong>REAL&nbsp;&nbsp;FUN</strong></header>
        <header class="layui-elip" style="margin-top: 10px;color: #fff">实 惠 娱 乐</header>-->
        <img src="../../../../Public/img/title.png" style="position: relative;left: -16px;height: 180px;width: 380px;margin-top: 80px;">
        <form class="layui-form">
            <div class="layui-input-inline">
                <input type="text" name="account" required lay-verify="required" placeholder="请输入账号"  autocomplete="off"
                       class="layui-input" style="background-color: rgba(255,255,255,0.2); color: rgb(240,222,112);">
            </div>
            <div class="layui-input-inline">
                <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off"
                       class="layui-input"  style="background-color: rgba(255,255,255,0.2); color: rgb(240,222,112);">
            </div>
            <div class="layui-input-inline">
                <input type="text" name="code" required lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input" style="width: 50%;float: left;background-color: rgba(255,255,255,0.2);color: rgb(240,222,112);">
                <img id="imgcode" onclick="changeCode()" src="{:U('common/verify')}" style="width: 50%;float: right;height: 38px;">
            </div>
            <div class="layui-input-inline login-btn">
                <button lay-submit lay-filter="login" class="layui-btn" style="background: rgb(240,222,112);color: #000;font-size: 18px;">登&nbsp录</button>
            </div>
            <div class="layui-input-inline">
                <a href="{:U('Common/forget')}" style="text-decoration: underline;float: right;height: 38px;color: rgb(240,222,112);">忘记密码</a>
            </div>
        </form>
    </div>
     
     
    <script type="text/javascript">
        window.onload = function(){
            if(top.location!=self.location)
            {
                top.location=self.location;
            }
        }
        //重新生成验证码
        function changeCode(){
            $("#imgcode").attr("src","{:U('common/verify',array('timestamp'=>"+new Date().getTime()+"))}");
        }

        layui.use(['form','layer','jquery'], function () {
     
            // 操作对象
            var form = layui.form;
            var $ = layui.jquery;
            form.on('submit(login)',function (data) {
                // console.log(data.field);
                $.ajax({
                    type:'post',
                    url:"{:U('Common/ctrl_login')}",
                    data:data.field,
                    dataType:'json',
                    success:function (rtJson) {
                        if (rtJson.code == 1){
                            layer.msg('<span style="color: rgb(240,222,112);">'+ rtJson.msg+'</span>');
                            location.href = "{:U('Index/index')}";

                        }else{
                            layer.msg('<span style="color: rgb(240,222,112);">'+ rtJson.msg+'</span>');
                            $("#imgcode").attr("src","{:U('common/verify',array('timestamp'=>"+new Date().getTime()+"))}");
                        }
                    }
                })
                return false;
            })
     
        });

        
    </script>
</body>
</html>